'use strict';
module.exports = app => {
  const { STRING, INTEGER, BOOLEAN, DATE, CHAR } = app.Sequelize; // 获取数据类型
  const TenantAdmin = app.modelmysql.define(
    'tenantadmin',
    {
      id: { type: CHAR(27), primaryKey: true },
      name: { type: STRING },
      muser: { type: STRING },
      mpassword: { type: STRING },
      memo: { type: STRING },
      enabled: { type: BOOLEAN },
      initFlag: { type: BOOLEAN },
      tid: { type: CHAR(27) },
      authorizeRequestId: { type: CHAR(27) },
      email: { type: STRING },
      companyURL: { type: STRING },
      telephone: { type: STRING },
      address: { type: STRING },
      users: { type: INTEGER },
      companyname: { type: STRING },
      years: { type: INTEGER },
      state: { type: BOOLEAN },
      code: { type: STRING },
      authorizedStartTime: { type: DATE },
      authorizedEndTime: { type: DATE },
      random: { type: STRING },
      period: { type: INTEGER },
      unit: { type: STRING },
      ftpIp: { type: STRING },
      ftpPassword: { type: STRING },
      acsURL: { type: STRING },
    }
  );
  TenantAdmin.associate = function() {
    app.modelmysql.TenantAdmin.hasMany(app.modelmysql.UserAdmin);
  };
  return TenantAdmin;
};
